package model

import (
	"time"
)

type BuyTicket struct {
	Id        uint      `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	BuyUserId uint      `gorm:"column:buy_user_id;type:bigint;comment:购票人;not null;" json:"buy_user_id"` // 购票人
	TicketId  uint      `gorm:"column:ticket_id;type:bigint;comment:车票id;not null;" json:"ticket_id"`    // 车票id
	CreatedAt time.Time `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdateAt  time.Time `gorm:"column:update_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"update_at"`
	DeleteAt  time.Time `gorm:"column:delete_at;type:datetime(3);default:NULL;" json:"delete_at"`
}

func (b *BuyTicket) TableName() string {
	return "buy_ticket"
}
